<template>
    <el-form :model="wPoolForm" status-icon :rules="rules" ref="wPoolForm"
             label-width="150px"
             style="margin-top: 10px;color: #1f2d3d">
        <el-form-item class="form-label" label="水池编码" prop="pid">
            <el-col :span="19">
                <el-input v-model="wPoolForm.pid" placeholder="水池编码"
                          maxlength="11" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="结构形式" prop="style">
            <el-col :span="19">
                <el-input v-model="wPoolForm.style" placeholder="结构形式"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="结构材料" prop="material">
            <el-col :span="19">
                <el-input v-model="wPoolForm.material" placeholder="结构材料"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="水池壁厚" prop="thickness">
            <el-col :span="19">
                <el-input v-model="wPoolForm.thickness" placeholder="水池壁厚"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="水池形状" prop="shape">
            <el-col :span="19">
                <el-input v-model="wPoolForm.shape" placeholder="水池形状(1圆形,2矩形)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="水池半径" prop="radius">
            <el-col :span="19">
                <el-input v-model="wPoolForm.radius" placeholder="水池半径(米)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="水池短边" prop="slength">
            <el-col :span="19">
                <el-input v-model="wPoolForm.slength" placeholder="水池短边(米)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="水池长边" prop="length">
            <el-col :span="19">
                <el-input v-model="wPoolForm.length" placeholder="水池长边(米)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="容量" prop="capacity">
            <el-col :span="19">
                <el-input v-model="wPoolForm.capacity" placeholder="容量(立方米/吨)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="水深度" prop="depth">
            <el-col :span="19">
                <el-input v-model="wPoolForm.depth" placeholder="水深度(米)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="水池高度" prop="height">
            <el-col :span="19">
                <el-input v-model="wPoolForm.height" placeholder="水池高度(米)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="矩形水池顶盖状况" prop="joint">
            <el-col :span="19">
                <el-input v-model="wPoolForm.joint" placeholder="矩整体性是否良好，与池壁、立柱是否有可靠连接(是/否)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="使用现状" prop="present">
            <el-col :span="19">
                <el-input v-model="wPoolForm.present" placeholder="使用现状"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="施工质量" prop="quality">
            <el-col :span="19">
                <el-input v-model="wPoolForm.quality" placeholder="施工质量"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁内侧竖向配筋表面形状" prop="surfaceShape1">
            <el-col :span="19">
                <el-input v-model="wPoolForm.surfaceShape1" placeholder="(1螺纹，2人字纹，3光面，4冷拔低碳)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁外侧竖向配筋表面形状" prop="surfaceShape2">
            <el-col :span="19">
                <el-input v-model="wPoolForm.surfaceShape2" placeholder="(1螺纹，2人字纹，3光面，4冷拔低碳)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁内侧竖向配筋直径" prop="diameter1">
            <el-col :span="19">
                <el-input v-model="wPoolForm.diameter1" placeholder="池壁内侧竖向配筋直径(mm)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁外侧竖向配筋直径" prop="diameter2">
            <el-col :span="19">
                <el-input v-model="wPoolForm.diameter2" placeholder="池壁外侧竖向配筋直径(mm)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="混凝土强度等级" prop="strengthGrade">
            <el-col :span="19">
                <el-input v-model="wPoolForm.strengthGrade" placeholder="混凝土强度等级"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁内侧竖向钢筋等级" prop="kinds1">
            <el-col :span="19">
                <el-input v-model="wPoolForm.kinds1" placeholder="池壁内侧竖向钢筋等级(1一级，2二级，3三级)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁外侧竖向钢筋等级" prop="kinds2">
            <el-col :span="19">
                <el-input v-model="wPoolForm.kinds2" placeholder="池壁外侧竖向钢筋等级(1一级，2二级，3三级)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁内侧最外层钢筋保护层厚度" prop="thicknessOfProtectiveLayer1">
            <el-col :span="19">
                <el-input v-model="wPoolForm.thicknessOfProtectiveLayer1" placeholder="池壁内侧最外层钢筋保护层厚度(mm)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁外侧最外层钢筋保护层厚度" prop="thicknessOfProtectiveLayer2">
            <el-col :span="19">
                <el-input v-model="wPoolForm.thicknessOfProtectiveLayer2" placeholder="池壁内侧最外层钢筋保护层厚度(mm)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁内侧竖向配筋" prop="verticalReinforcement1">
            <el-col :span="19">
                <el-input v-model="wPoolForm.verticalReinforcement1" placeholder="池壁内侧竖向配筋(平方毫米)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="池壁外侧竖向配筋" prop="verticalReinforcement2">
            <el-col :span="19">
                <el-input v-model="wPoolForm.verticalReinforcement2" placeholder="池壁外侧竖向配筋(平方毫米)"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="设防烈度" prop="intensity">
            <el-col :span="19">
                <el-input v-model="wPoolForm.intensity" placeholder="设防烈度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="场地类别" prop="site">
            <el-col :span="19">
                <el-input v-model="wPoolForm.site" placeholder="场地类别"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>

        <el-form-item class="form-label" label="建设年代" prop="year">
            <el-col :span="19">
                <el-input v-model="wPoolForm.year" placeholder="建设年代"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="6度时液化程度" prop="liquefaction6">
            <el-col :span="19">
                <el-input v-model="wPoolForm.liquefaction6" placeholder="6度时液化程度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="7度时液化程度" prop="liquefaction7">
            <el-col :span="19">
                <el-input v-model="wPoolForm.liquefaction7" placeholder="7度时液化程度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="8度时液化程度" prop="liquefaction8">
            <el-col :span="19">
                <el-input v-model="wPoolForm.liquefaction8" placeholder="8度时液化程度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="9度时液化程度" prop="liquefaction9">
            <el-col :span="19">
                <el-input v-model="wPoolForm.liquefaction9" placeholder="9度时液化程度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="6度时震陷程度" prop="seismicsubsidence6">
            <el-col :span="19">
                <el-input v-model="wPoolForm.seismicsubsidence6" placeholder="6度时震陷程度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="7度时震陷程度" prop="seismicsubsidence7">
            <el-col :span="19">
                <el-input v-model="wPoolForm.seismicsubsidence7" placeholder="7度时震陷程度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="8度时震陷程度" prop="seismicsubsidence8">
            <el-col :span="19">
                <el-input v-model="wPoolForm.seismicsubsidence8" placeholder="8度时震陷程度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="9度时震陷程度" prop="seismicsubsidence9">
            <el-col :span="19">
                <el-input v-model="wPoolForm.seismicsubsidence9" placeholder="9度时震陷程度"
                          maxlength="20" autocomplete="off"></el-input>
            </el-col>
        </el-form-item>
        <el-form-item class="form-label" label="关联子任务" prop="sid" style="display: none">
            <el-input v-model="wPoolForm.sid"
                      maxlength="20" autocomplete="off"/>
        </el-form-item>
    </el-form>
</template>

<script>
    import qs from 'qs';

    export default {
        name: "NewWaterBang",
        data() {
            return {
                wPoolForm: {
                    id: '',
                    pid: '',
                    style: '',
                    material: '',
                    thickness: '',
                    shape: '',
                    radius: '',
                    slength: '',
                    length: '',
                    capacity: '',
                    depth: '',
                    height: '',
                    joint: '',
                    present: '',
                    quality: '',
                    surfaceShape1: '',
                    surfaceShape2: '',
                    diameter1: '',
                    diameter2: '',
                    strengthGrade: '',
                    kinds1: '',
                    kinds2: '',
                    thicknessOfProtectiveLayer1: '',
                    thicknessOfProtectiveLayer2: '',
                    verticalReinforcement1: '',
                    verticalReinforcement2: '',
                    intensity: '',
                    site: '',
                    year: '',
                    liquefaction6: '',
                    liquefaction7: '',
                    liquefaction8: '',
                    liquefaction9: '',
                    seismicsubsidence6: '',
                    seismicsubsidence7: '',
                    seismicsubsidence8: '',
                    seismicsubsidence9: '',
                    remark: '',
                    sid: ''
                },
                rules: {
                    pid: [],
                    style: [],
                    material: [],
                    thickness: [],
                    shape: [],
                    radius: [],
                    slength: [],
                    length: [],
                    capacity: [],
                    depth: [],
                    height: [],
                    joint: [],
                    present: [],
                    quality: [],
                    surfaceShape1: [],
                    surfaceShape2: [],
                    diameter1: [],
                    diameter2: [],
                    strengthGrade: [],
                    kinds1: [],
                    kinds2: [],
                    thicknessOfProtectiveLayer1: [],
                    thicknessOfProtectiveLayer2: [],
                    verticalReinforcement1: [],
                    verticalReinforcement2: [],
                    intensity: [],
                    site: [],
                    year: [],
                    liquefaction6: [],
                    liquefaction7: [],
                    liquefaction8: [],
                    liquefaction9: [],
                    seismicsubsidence6: [],
                    seismicsubsidence7: [],
                    seismicsubsidence8: [],
                    seismicsubsidence9: [],
                    remark: []
                }
            }
        },
        mounted() {
            if (this.id !== -1) {
                axios.post("/bjdzms/waterPoolData/findById",
                    qs.stringify({
                        'id': this.id
                    })).then(res => {
                    this.wPoolForm = res.data.datas;
                });
            }
        },
        props: {
            sid: {
                type: Number,
                default: -1
            },
            id: {
                type: Number,
                default: -1
            }
        },
        methods: {
            to(path) {
                this.$router.push({name: path});
            },
            submitForm() {
                if (this.id !== -1) {
                    this.wPoolForm.id = this.id;
                    axios.post("/bjdzms/waterPoolData/upd",
                        qs.stringify(this.wPoolForm)
                    ).then(res => {
                        this.$emit('updateData');
                    });
                } else {
                    this.wPoolForm.sid = this.sid;
                    axios.post("/bjdzms/waterPoolData/add",
                        qs.stringify(this.wPoolForm)
                    ).then(res => {
                        this.$emit('updateData');
                    });
                }
            }
        }
    }
</script>

<style>
    .el-upload-dragger {
        height: 40px !important;
    }
</style>

<style scoped>
    .el-header {
        background: #EBEBEB;
        color: #e5e9ef;
        font-size: 2em;
        line-height: 80px;
        border: 5px solid #EBEBEB;
    }

    .el-main {
        background: #fff;
    }

    .el-container {
        height: 100%;
    }

    .el-form-item {
        width: 610px;
    }
</style>
